vui.Namespace('View.page2.Msg', function () {
    var _this = this;
    _this.Init = function () {
        vui.Page.Init({
            componentList: [ 'HeaderBox', 'LeftMenu', 'TableList', 'UploadImages', 'UploadFiles', {
                id: 'Msg',
                isPage: true,
                baseDir:'/demo/'
            }],
            fn: function () {
                _bindData();
                _bindEvent();
            }
        })
    }
    //初始化本地数据
    var _bindData = function () {
        var data = {
            Assignor: "",
            CustomerName: "",
            CustomerPhone: "",
            FirstVisitDate: "",
            FollowUpDateEnd: "",
            FollowUpDateStart: "",
            IProjectID: "31d07d12-6f94-e711-80c7-00505686c900",
            PageIndex: 1,
            PageSize: 6,
            ProjectID: "31d07d12-6f94-e711-80c7-00505686c900",
            SaleUserID: "",
            SourceTypeID: ""
        }
        var pageData = {
            table1: {
                columns: [
                    {
                        title: '',
                        dataIndex: 'column-Radio',
                        width: "50px",
                        className: "column-Radio",

                    },
                    {
                        title: '序号',
                        dataIndex: 'column-Num',
                        width: "70px",
                        className: "column-Num",

                    },
                    {
                        title: '姓名',
                        dataIndex: 'Name',

                    }, {
                        title: '意向项目',
                        dataIndex: 'IntentProjectName',
                    }, {
                        title: '客户来源',
                        dataIndex: 'OpportunitySource',
                    }, {
                        title: '创建时间',
                        dataIndex: 'CreateTime',
                    }, {
                        title: '推荐人信息',
                        dataIndex: 'ReportUserName',
                    }, {
                        title: '推荐时间',
                        dataIndex: 'ReportTime',
                    }, {
                        title: '置业顾问',
                        dataIndex: 'SaleUserName',
                    }, {
                        title: '所属团队',
                        dataIndex: 'SaleTeamName',
                    }, {
                        title: '最后跟进时间',
                        dataIndex: 'FollowUpCreateDate',
                    },
                ],
                dataSource: [],

                isChoose: false,
                checkKey: "",
                loading: false,
                pagination: {
                    defaultCurrent: 1,
                    total: 0,
                    showSizeChanger: true,
                    pageSizeOptions: [
                        "6", "8", "10", "15"
                    ],
                    defaultPageSize: "6"
                }
            },
        }
        vui.Page.Render({
            id: ".app",
            componentID: "Page",
            isPage: true,
            template: '<Page />',
            data: pageData,
        });
        vui.Component.Page.setState(pageData);
        vui.Catch = {
            callBack: function (page,pageSize) {
                
                data.PageIndex = page;
                data.PageSize = pageSize;

                vui.Data.getFuncData({
                    funcid: "CustomerList_Select",
                    param: data,
                    success: function (res) {
                        pageData.table1.dataSource = res.data.List ? res.data.List : [];
                        pageData.table1.pagination.defaultCurrent = page;
                        pageData.table1.pagination.total = res.data.AllCount ? res.data.AllCount : 0;
                        pageData.table1.pagination.defaultPageSize = pageSize;
                        vui.Component.Page.setState(pageData);

                    }
                });
            },
            clear:function(){
            	vui.Component.Page.setState(pageData);
            }
        }
//      vui.Data.getFuncData({
//          funcid: "CustomerList_Select",
//          param: data,
//          success: function (res) {
//              pageData.table1.dataSource = res.data.List ? res.data.List : [];
//              pageData.table1.pagination.total = res.data.AllCount ? res.data.AllCount : 0;
//              vui.Page.Render({
//                  id: ".app",
//                  componentID: "Page",
//                  isPage: true,
//                  template: '<Page />',
//                  data: pageData
//              });
//              
//          }
//      });
//      
       
        


       
        
    }
    
    //初始化事件
    var _bindEvent = function () {

    }
})
